package common;

import java.util.Iterator;
import java.util.Properties;

import dao.FileIO;

public class BatchedInputWrapper extends InputWrapper {

	private Iterator<String> itr;
	
	@Override
	public void initialize(Properties properties) {
		itr = FileIO.readFile(properties.getProperty("test_file")).iterator();
	}
	
	public void initialize(String filename) {
		itr = FileIO.readFile(filename).iterator();
	}

	@Override
	public String next() {
		String result;
		if(itr.hasNext()) {
			result = itr.next();
		} else {
			result = null;
		}
		
		return result;
	}
	
}
